﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ComponentModel.DataAnnotations;
using ESOL.Common.Entity;

namespace ESOL.Common.Entity
{
    [DataContract]
    public class InvWhQueryCondition
    {
    }

    [DataContract]
    public class InvStgQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public string ParentType { set; get; }
        [DataMember]
        public string ChildType { set; get; }
        [DataMember]
        public string ProductName { set; get; }
        [DataMember]
        public string ProductCode { set; get; }
        [DataMember]
        public int IsLock { set; get; }
        [DataMember]
        public int IsActive { set; get; }
    }

    [DataContract]
    public class InvMaintainWh
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public DateTime CreatedDate { set; get; }
        [DataMember]
        public string UpdatedBy { set; get; }
        [DataMember]
        public string UpdatedUser { set; get; }
        [DataMember]
        public DateTime UpdatedDate { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string WhName { set; get; }
        [DataMember]
        public string Position { set; get; }
        [DataMember]
        public string Description { set; get; }
        [DataMember]
        public string Type { set; get; }
        [DataMember]
        public string ManagedBy { set; get; }
        [DataMember]
        public string ManagedUser { set; get; }
        [DataMember]
        public int IsLock { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    //入库申请单
    [DataContract]
    public class InvMaintainIApp
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public DateTime CreatedDate { set; get; }
        [DataMember]
        public string UpdatedBy { set; get; }
        [DataMember]
        public string UpdatedUser { set; get; }
        [DataMember]
        public DateTime UpdatedDate { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string AppNo { set; get; }
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public string RelatedNo { set; get; }
        [DataMember]
        public string Remark { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class InvIAppItemDto
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string IoAppId { set; get; }
        [DataMember]
        public string ProductId { set; get; }
        [DataMember]
        public decimal Qty { set; get; }
        [DataMember]
        public string ProductName { set; get; }
        [DataMember]
        public string ProductCode { set; get; }
        [DataMember]
        public string Unit { set; get; }
    }

    [DataContract]
    public class InvIAppQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public int? IsActive { set; get; }
        [DataMember]
        public string AppNo { set; get; }
        [DataMember]
        public int? Type { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class InvIappSaveParam
    {
        [DataMember]
        public string curUserNo { set; get; }
        [DataMember]
        public InvMaintainIApp app { set; get; }
        [DataMember]
        public List<InvIAppItemDto> addItems { set; get; }
        [DataMember]
        public List<InvIAppItemDto> updatedItems { set; get; }
        [DataMember]
        public List<InvIAppItemDto> delItems { set; get; }
    }

    //入库单
    [DataContract]
    public class InvMaintainIo
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public DateTime CreatedDate { set; get; }
        [DataMember]
        public string UpdatedBy { set; get; }
        [DataMember]
        public string UpdatedUser { set; get; }
        [DataMember]
        public DateTime UpdatedDate { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public string IoNo { set; get; }
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public string RelatedNo { set; get; }
        [DataMember]
        public string Remark { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class InvIoQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public string IoNo { set; get; }
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class InvMaintainIoi
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string IoId { set; get; }
        [DataMember]
        public string ProductId { set; get; }
        [DataMember]
        public string ProductName { set; get; }
        [DataMember]
        public string ProductCode { set; get; }
        [DataMember]
        public decimal Qty { set; get; }
        [DataMember]
        public string Unit { set; get; }
        [DataMember]
        public string Remark { set; get; }
        [DataMember]
        public string WarehouseId { set; get; }
        [DataMember]
        public string WarehouseName { set; get; }
        [DataMember]
        public string LocationId { set; get; }
        [DataMember]
        public string Stand { set; get; }
        [DataMember]
        public string LocationNo { set; get; }
        [DataMember]
        public decimal Volume { set; get; }
        [DataMember]
        public decimal Area { set; get; }
        [DataMember]
        public int IsSingle { set; get; }
        [DataMember]
        public string RelatedNo { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public string LotNo { set; get; }
    }

    [DataContract]
    public class InvStockInResultMessage
    {
        [DataMember]
        public bool Result { set; get; }
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string Message { set; get; }
    }

    [DataContract]
    public class InvMaintainCApp
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public DateTime CreatedDate { set; get; }
        [DataMember]
        public string UpdatedBy { set; get; }
        [DataMember]
        public string UpdatedUser { set; get; }
        [DataMember]
        public DateTime UpdatedDate { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string AppNo { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public DateTime BeginDate { set; get; }
        [DataMember]
        public DateTime EndDate { set; get; }
        [DataMember]
        public string Remark { set; get; }
        [DataMember]
        public string Status { set; get; }

    }

    [DataContract]
    public class InvCAppQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public DateTime CreatedDateFrom { set; get; }
        [DataMember]
        public DateTime CreatedDateTo { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public string Status { set; get; }

    }

    [DataContract]
    public class InvMaintainCo
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public DateTime CreatedDate { set; get; }
        [DataMember]
        public string UpdatedBy { set; get; }
        [DataMember]
        public string UpdatedUser { set; get; }
        [DataMember]
        public DateTime UpdatedDate { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string CoNo { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public DateTime BeginDate { set; get; }
        [DataMember]
        public DateTime EndDate { set; get; }
        [DataMember]
        public string Remark { set; get; }
        [DataMember]
        public string Status { set; get; }

    }

    [DataContract]
    public class InvCoQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public string CoNo { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    [DataContract]
    public class InvMaintainCoi
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string CoId { set; get; }
        [DataMember]
        public string LocationId { set; get; }
        [DataMember]
        public string LocationExId { set; get; }
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public string Stand { set; get; }
        [DataMember]
        public string LocationNo { set; get; }
        [DataMember]
        public decimal Volume { set; get; }
        [DataMember]
        public decimal Area { set; get; }
        [DataMember]
        public string ProductId { set; get; }
        [DataMember]
        public string ProductName { set; get; }
        [DataMember]
        public string ProductCode { set; get; }
        [DataMember]
        public decimal CurQty { set; get; }
        [DataMember]
        public decimal ChkQty { set; get; }
        [DataMember]
        public decimal DiffQty { set; get; }
        [DataMember]
        public string Remark { set; get; }

        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public string LotNo { set; get; }
        [DataMember]
        public int IsFull { set; get; }
    }

    //出库申请单
    [DataContract]
    public class InvMaintainOApp
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public DateTime CreatedDate { set; get; }
        [DataMember]
        public string UpdatedBy { set; get; }
        [DataMember]
        public string UpdatedUser { set; get; }
        [DataMember]
        public DateTime UpdatedDate { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string AppNo { set; get; }
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public string RelatedNo { set; get; }
        [DataMember]
        public string Remark { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    public class InvOAppSaveParam
    {
        [DataMember]
        public string CurUserNo { set; get; }
        [DataMember]
        public InvOappEntity Oapp { set; get; }
        [DataMember]
        public List<InvOAppItemDto> AddItems { set; get; }
        [DataMember]
        public List<InvOAppItemDto> UpdatedItems { set; get; }
        [DataMember]
        public List<InvOAppItemDto> DelItems { set; get; }
    }

    [DataContract]
    public class InvOAppQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public int? IsActive { set; get; }
        [DataMember]
        public string AppNo { set; get; }
        [DataMember]
        public int? Type { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    //出库申请单明细
    [DataContract]
    public class InvOAppItemDto
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string OoAppId { set; get; }
        [DataMember]
        public string ProductId { set; get; }
        [DataMember]
        public decimal Qty { set; get; }
        [DataMember]
        public DateTime ReqDate { set; get; }
        [DataMember]
        public string Remark { set; get; }

        [DataMember]
        public string ProductName { set; get; }
        [DataMember]
        public string ProductCode { set; get; }
        [DataMember]
        public string Unit { set; get; }
        [DataMember]
        public decimal CurStgQty { set; get; }
        [DataMember]
        public decimal AvailableStgQty { set; get; }
    }

    //出库单
    [DataContract]
    public class InvMaintainOo
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public DateTime CreatedDate { set; get; }
        [DataMember]
        public string UpdatedBy { set; get; }
        [DataMember]
        public string UpdatedUser { set; get; }
        [DataMember]
        public DateTime UpdatedDate { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string OoNo { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public string WhName { set; get; }
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public string RelatedNo { set; get; }
        [DataMember]
        public string Remark { set; get; }
        [DataMember]
        public string Status { set; get; }
    }

    //出库单明细
    [DataContract]
    public class InvOoItemDto
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string OoId { set; get; }
        [DataMember]
        public string ProductId { set; get; }
        [DataMember]
        public decimal Qty { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public string LocationId { set; get; }
        [DataMember]
        public string Remark { set; get; }

        [DataMember]
        public string ProductName { set; get; }
        [DataMember]
        public string ProductCode { set; get; }
        [DataMember]
        public string Unit { set; get; }
        [DataMember]
        public string WhName { set; get; }
        [DataMember]
        public string Stand { set; get; }
        [DataMember]
        public string LocationName { set; get; }
        [DataMember]
        public decimal CurStgQty { set; get; }
        [DataMember]
        public decimal AvaliableStgQty { set; get; }
        [DataMember]
        public int InvStoreType { set; get; }
        [DataMember]
        public string LotNo { set; get; }
    }

    //出库单保存参数
    [DataContract]
    public class InvOoSaveParam
    {
        [DataMember]
        public string CurUserNo { set; get; }
        [DataMember]
        public InvOoEntity Oo { set; get; }
        [DataMember]
        public List<InvOoItemDto> AddItems { set; get; }
        [DataMember]
        public List<InvOoItemDto> UpdatedItems { set; get; }
        [DataMember]
        public List<InvOoItemDto> DelItems { set; get; }
    }

    //出库单查询条件
    [DataContract]
    public class InvOoQueryCondition
    {
        [DataMember]
        public string curUserId { set; get; }
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }

        [DataMember]
        public string OoNo { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string Status { set; get; }
        [DataMember]
        public string OappUserName { set; get; }
        [DataMember]
        public string OappUserNo { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public string CreatedUser { set; get; }
    }

    [DataContract]
    public class InvOoDto
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public DateTime CreatedDate { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public DateTime UpdatedDate { set; get; }
        [DataMember]
        public string UpdatedBy { set; get; }
        [DataMember]
        public int IsActive { set; get; }
        [DataMember]
        public string OappId { set; get; }
        [DataMember]
        public string OappNo { set; get; }
        [DataMember]
        public string OoNo { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public string WhName { set; get; }
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public string RelatedNo { set; get; }
        [DataMember]
        public string Remark { set; get; }
        [DataMember]
        public string Status { set; get; }

        [DataMember]
        public string AppUserName { set; get; }
        [DataMember]
        public string AppUserNo { set; get; }
        [DataMember]
        public string AppUser { set; get; }
    }

    [DataContract]
    public class InvOoPageResult
    {
        [DataMember]
        public int TotalCount { set; get; }
        [DataMember]
        public List<InvOoDto> OutOrders { set; get; }
    }

    //自动分配出库库位参数
    [DataContract]
    public class InvAutoAssignOutLocationParam
    {
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public int StoreType { set; get; }
        [DataMember]
        public List<InvOoItemDto> ItemsDto { set; get; }
    }

    //出库结果
    [DataContract]
    public class InvStockOutResultMessage
    {
        [DataMember]
        public bool Result { set; get; }
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string Message { set; get; }
    }


    //库位属性
    [DataContract]
    public class InvWhItemExDto
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string WhId { set; get; }
        [DataMember]
        public string ProductTypeId { set; get; }
        [DataMember]
        public int Level { set; get; }
        [DataMember]
        public string ProductTypeName { set; get; }

    }

    [DataContract]
    public class InvLocationExUpdateParam
    {
        [DataMember]
        public string UserNo { set; get; }
        [DataMember]
        public string LocId { set; get; }
        [DataMember]
        public string MaterialId { set; get; }
        [DataMember]
        public string InvIoId { set; get; }

        [DataMember]
        public string SelectedInvIoId { set; get; }
        [DataMember]
        public string SelectedLocId { set; get; }
        [DataMember]
        public string SelectedMaterialId { set; get; }
        [DataMember]
        public int SelectedExType { set; get; }
    }

    [DataContract]
    public class InvLocationExDelParam
    {
        [DataMember]
        public string UserNo { set; get; }

        [DataMember]
        public string SelectedInvIoId { set; get; }
        [DataMember]
        public string SelectedLocId { set; get; }
        [DataMember]
        public string SelectedMaterialId { set; get; }
        [DataMember]
        public int SelectedExType { set; get; }
    }

    [DataContract]
    public class InvMaintainOoi
    {
        [DataMember]
        public string Id { set; get; }
        [DataMember]
        public string OoId { set; get; }
        [DataMember]
        public string ProductId { set; get; }
        [DataMember]
        public string ProductName { set; get; }
        [DataMember]
        public string ProductCode { set; get; }
        [DataMember]
        public decimal Qty { set; get; }
        [DataMember]
        public string Remark { set; get; }
        [DataMember]
        public string LocationId { set; get; }
        [DataMember]
        public string Stand { set; get; }
        [DataMember]
        public string LocationNo { set; get; }
        [DataMember]
        public decimal Volume { set; get; }
        [DataMember]
        public decimal Area { set; get; }
        [DataMember]
        public int IsSingle { set; get; }
        [DataMember]
        public string RelatedNo { set; get; }
        [DataMember]
        public string RelatedId { set; get; }
        [DataMember]
        public int Type { set; get; }
        [DataMember]
        public decimal LocationCurrentQty { set; get; }
        [DataMember]
        public string Unit { set; get; }
    }
    
    [DataContract]
    public class InvMaintainMtrlTrans : InvMtrlTransEntity
    {
        [DataMember]
        public string CreatedUser { set; get; }
        [DataMember]
        public string UpdatedUser { set; get; }
    }

    [DataContract]
    public class InvMtrlTransQueryCondition
    {
        [DataMember]
        public int txtPageIndex { set; get; }
        [DataMember]
        public int txtPageSize { set; get; }
        [DataMember]
        public string CreatedBy { set; get; }
        [DataMember]
        public int? IsActive { set; get; }
        [DataMember]
        public string TransType { set; get; }
        [DataMember]
        public string Status { set; get; }
        [DataMember]
        public string WoNo { set; get; }
        [DataMember]
        public string TransNo { set; get; }
    }


    [DataContract]
    public class InvMaintainProdInventoryItem
    {
        #region
        [DataMember]
        public string Id { get; set; }

        [DataMember]
        public string InvId { get; set; }

        [DataMember]
        public string InvNo { get; set; }

        [DataMember]
        public string ProdSn { get; set; }

        [DataMember]
        public int ProdQty { get; set; }

        [DataMember]
        public string Unit { get; set; }

        [DataMember]
        public string CurTechnicNo { get; set; }

        [DataMember]
        public string CurTechnicName { get; set; }

        [DataMember]
        public string TechnicItemId { get; set; }

        [DataMember]
        public string CurWorkgroupNo { get; set; }
        [DataMember]
        public string CurWorkgroupName { get; set; }

        [DataMember]
        public string CurAssetCode { get; set; }

        [DataMember]
        public string CurAssetName { get; set; }

        #endregion
    }

}
